<?php

namespace App\View\Components;

use Illuminate\View\Component;

class Breadcrumb extends Component
{
    /**
     * id选择器名
     * @var
     */
    public $id = "";

    /**
     * class选择器名
     * @var
     */
    public $class = "";

    /**
     * 面包屑数据
     * @var
     * [
     *  [
     *      'title' => '', // 标题
     *      'href_' => '', // 链接
     *      'href_target_' => '', // 打开方式
     *      'rel_' => '', // 禁止搜索引擎跟踪链接
     *      ......
     *  ],
     * ]
     */
    public $list = [];

    /**
     * Create a new component instance.
     *
     * @return void
     */
    public function __construct($id = "", $class = "", $list = [])
    {
        $this->id = $id ?: $this->id;
        $this->class = $class ?: $this->class;
        $this->list = $list ?: $this->list;
    }

    /**
     * Get the view / contents that represent the component.
     *
     * @return \Illuminate\Contracts\View\View|\Closure|string
     */
    public function render()
    {
        return view('components.breadcrumb');
    }
}
